//第一版
function objectFactory(){
    var obj=new Object();
    var Constructor=[].shift.call(arguments);
    obj.__proto__=Constructor.prototype;
    Constructor.apply(obj,arguments);
//原型数据继承
//构造函数数据继承
    return obj;
}

function Otaku (name, age) {
    this.name = name;
    this.age = age;

    this.habit = 'Games';
}

// 因为缺乏锻炼的缘故，身体强度让人担忧
Otaku.prototype.strength = 60;

Otaku.prototype.sayYourName = function () {
    console.log('I am ' + this.name);
}
var person=objectFactory(Otaku,'wang',11);
console.log(person.name) // Kevin
console.log(person.habit) // Games
console.log(person.strength) // 60

person.sayYourName(); // I am Kevin
